List subscription phases
curl --request GET \
--url https://api.hyperline.co/v2/subscriptions/{id}/phases \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hyperline.co/v2/subscriptions/{id}/phases"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hyperline.co/v2/subscriptions/{id}/phases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperline.co/v2/subscriptions/{id}/phases",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hyperline.co/v2/subscriptions/{id}/phases"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hyperline.co/v2/subscriptions/{id}/phases")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v2/subscriptions/{id}/phases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"meta": {
"total": 1,
"taken": 1,
"skipped": 0
},
"data": [
{
"id": "sup_1FoLfIQ5VOMbXf",
"name": "Initial term",
"type": "standard",
"status": "pending",
"order": 0,
"activation_strategy": "manual",
"end_strategy": "duration",
"duration": {
"count": 1,
"period": "years"
},
"billing_date_setting": "phase_start",
"initial_billing_at": null,
"starts_at": null,
"ends_at": null,
"billing_cycle_alignment": "anniversary",
"do_not_invoice_phase": false,
"transition_calculation_method": "prorata",
"transition_invoicing_schedule": "immediately",
"products": [
{
"id": "itm_FJKlqUb8COXw55",
"name": "Product name",
"description": "A description of the product.",
"description_display_interval_dates": true,
"attached_at": "2024-01-15T00:00:00Z",
"detached_at": "2024-04-15T00:00:00Z",
"current_period_started_at": "2024-01-15T00:00:00Z",
"current_period_ends_at": "2024-02-15T00:00:00Z",
"next_payment_at": "2024-02-15T00:00:00Z",
"payment_interval": {
"period": "once"
},
"payment_schedule": "start",
"type": "flat_fee",
"count": 1,
"prices": [
{
"type": "fee",
"amount": 123,
"id": "<string>"
}
]
}
],
"coupons": [
{
"description": null,
"expiration_date": null,
"redemption_limit": null,
"product_ids": [
"itm_FJKlqUb8COXw55"
],
"repeat": "forever",
"duration": {
"count": 3,
"period": "months"
},
"created_at": "2024-12-20T16:04:11Z",
"type": "amount",
"discount_amount": 2000,
"currency": "EUR",
"id": "cou_DKL4Xcb5VSa8CQ",
"promotion_code_id": null,
"name": "Partner discount",
"subscription_coupon_id": "coos_d9pVekhjoGppuX",
"duration_count": 123,
"apply_at": null,
"expires_at": null
}
],
"created_at": "2024-10-12T07:00:01.860Z",
"updated_at": "2024-10-12T07:00:01.860Z"
}
]
}{
"message": "<string>"
}Subscriptions > Phases
List subscription phases
Retrieve the details of the phases for an existing subscription.
GET
/
v2
/
subscriptions
/
{id}
/
phases
List subscription phases
curl --request GET \
--url https://api.hyperline.co/v2/subscriptions/{id}/phases \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hyperline.co/v2/subscriptions/{id}/phases"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hyperline.co/v2/subscriptions/{id}/phases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperline.co/v2/subscriptions/{id}/phases",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hyperline.co/v2/subscriptions/{id}/phases"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hyperline.co/v2/subscriptions/{id}/phases")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v2/subscriptions/{id}/phases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"meta": {
"total": 1,
"taken": 1,
"skipped": 0
},
"data": [
{
"id": "sup_1FoLfIQ5VOMbXf",
"name": "Initial term",
"type": "standard",
"status": "pending",
"order": 0,
"activation_strategy": "manual",
"end_strategy": "duration",
"duration": {
"count": 1,
"period": "years"
},
"billing_date_setting": "phase_start",
"initial_billing_at": null,
"starts_at": null,
"ends_at": null,
"billing_cycle_alignment": "anniversary",
"do_not_invoice_phase": false,
"transition_calculation_method": "prorata",
"transition_invoicing_schedule": "immediately",
"products": [
{
"id": "itm_FJKlqUb8COXw55",
"name": "Product name",
"description": "A description of the product.",
"description_display_interval_dates": true,
"attached_at": "2024-01-15T00:00:00Z",
"detached_at": "2024-04-15T00:00:00Z",
"current_period_started_at": "2024-01-15T00:00:00Z",
"current_period_ends_at": "2024-02-15T00:00:00Z",
"next_payment_at": "2024-02-15T00:00:00Z",
"payment_interval": {
"period": "once"
},
"payment_schedule": "start",
"type": "flat_fee",
"count": 1,
"prices": [
{
"type": "fee",
"amount": 123,
"id": "<string>"
}
]
}
],
"coupons": [
{
"description": null,
"expiration_date": null,
"redemption_limit": null,
"product_ids": [
"itm_FJKlqUb8COXw55"
],
"repeat": "forever",
"duration": {
"count": 3,
"period": "months"
},
"created_at": "2024-12-20T16:04:11Z",
"type": "amount",
"discount_amount": 2000,
"currency": "EUR",
"id": "cou_DKL4Xcb5VSa8CQ",
"promotion_code_id": null,
"name": "Partner discount",
"subscription_coupon_id": "coos_d9pVekhjoGppuX",
"duration_count": 123,
"apply_at": null,
"expires_at": null
}
],
"created_at": "2024-10-12T07:00:01.860Z",
"updated_at": "2024-10-12T07:00:01.860Z"
}
]
}{
"message": "<string>"
}Was this page helpful?
⌘I

